<!-- index.html -->
<!DOCTYPE html>
<html>
<body>
<p>同步方法</p>
<button onclick="toast()">调用toast方法(无返回值)</button>
<br/><br/><br/>
<button onclick="isLoginExpire()">调用isLoginExpire方法(有返回值)</button>
<br/><br/><br/>
<button onclick="isLoginExpireNoParams()">调用isLoginExpireNoParams方法(有返回值,无参数)</button>
<br/><br/><br/>
<button onclick="getDeviceInfo()">调用getDeviceInfo方法(有回调)</button>
<br/><br/><br/>

<script type="text/javascript">

  function test() {
      console.log("WebPage",'Ark WebComponent');
      return "This value is from index.html";
  }

  function toast() {
      BasilicaAppJS.prompt('{\"funcName\":\"toast\",\"funcParam\":{\"msg\":\"H5调用的toast方法\"}}');
      console.log("WebPage","toast");
  }

  function isLoginExpire() {
    var result = BasilicaAppJS.prompt('{\"funcName\":\"isLoginExpire\",\"funcParam\":{}}');
    console.log("WebPage",result);
  }

  function isLoginExpireNoParams() {
    var result = BasilicaAppJS.prompt('{\"funcName\":\"isLoginExpire\",\"callbackId\":\"fdsaf\"}');
    console.log("WebPage",result);
  }

  function getDeviceInfo() {
    var result = BasilicaAppJS.prompt('{\"funcName\":\"getDeviceInfo\",\"callbackId\":\"fdsaf\"}');
    console.log("WebPage",result);
  }

  var BasilicaNativeJS = {
    basilica_ncallback:(data)=>{
        console.log("WebPage:basilica_ncallback",data);
    }
  }




</script>

</body>


<!--console.log("WebPage",BasilicaAppJS.prompt('{\"callbackId\":\"fdsafwerq\",\"name\":\"张三\",\"funcName\":\"request\"}'))-->
<!--console.log("WebPage",BasilicaAppJS.prompt('{\"funcName\":\"toast\",\"name\":\"张三\"}'))-->
<!--console.log("WebPage",BasilicaAppJS.prompt('{\"callbackId\":\"fdsafwerq\",\"funcParam\":{\"msg\":\"H5调用的toast方法\"},\"funcName\":\"toast\"}'))-->


</html>